package org.anachronos.jeep.ui.attach;

import org.anachronos.jeep.core.attach.VirtualMachineAttachement;
import org.anachronos.jeep.core.attach.VirtualMachineAttachement.State;
import org.eclipse.core.expressions.PropertyTester;

public class VirtualMachineAttachmentPropertyTester extends PropertyTester {

	@Override
	public boolean test(Object receiver, String property, Object[] args,
			Object expectedValue) {
		final VirtualMachineAttachement virtualMachineAttachement = (VirtualMachineAttachement) receiver;
		final State expectedState = State.valueOf(expectedValue.toString());
		final boolean equals = virtualMachineAttachement.getState()
			.equals(expectedState);
		return equals;
	}
}
